home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_ImportAdv / README < prev    next >
Encoding:
Text File  |  1992-12-19  |  4.5 KB  |  90 lines

  1.  
  2. README file for the ImportAdvanced application.
  3.  
  4. This application covers importing and exporting EPS files and TIFF images.
  5. The important aspects here are caching the image in an NXImage and imaging
  6. it within an NXEPSImageRep. The NXEPSImageRep switches contexts which
  7. provides for a more robust recovery when errors are encountered in an EPS file.
  8. Without a separate context, errors within an EPS file could sink the application's
  9. context. The NXImage improves scrolling and other areas where quick redrawing
  10. is necessary.
  11.  
  12. Other important aspects are the checking of the some of the included resources
  13. (fonts and files). A panel is displayed showing which resources are missing. If a
  14. %%IncludeFile: comment is encountered, then a temporary file or memory stream
  15. is written with the included file or files incorporated into it. Its this file or memory stream
  16. that's used for imaging. (This is done behind the veil of the NXEPSImageRep, but its
  17. hope that this functionality will be incorporated into the class at some later point.)
  18.  
  19. The files can be copied into the document or imported by reference. Unfortunately,
  20. a little more work needs to be done to allow the user to locate a referenced file if it
  21. cannot be found. (That's left as an exercise for the reader.)
  22.  
  23. The saveTo: menu item initiates the path to output the Adobe Illustrator compatible
  24. code for EPS files. Including a preview image as a comment in the file is also an option
  25. when saving as EPS.
  26.  
  27. Another aspect of the application is the user interface. Importing by dragging out
  28. is possible as well as dropping in. The user can rotate the files and zoom in and out.
  29. These guidelines are not meant to establish a standard but provide a base from which
  30. to best decide what may work for a particular application.
  31.  
  32. Portions of the source code in this application are based on source code
  33. from the Draw example application provided by NeXT.
  34.  
  35.  
  36. Below lies an annotated list of the files used in the application. The
  37. classes listed first form the majority of the application and are
  38. the more important ones to note. The others fill support roles.
  39.  
  40. ImportApp        - A subclass of Application. Manages the global operations.
  41. Document        - A subclass of Responder. Manages the operations for a document.
  42.                     Operations such as import, save, etc.
  43. DocView            - A subclass of View. Resides as the DocView of a ClipView and
  44.                     DrawingView. Positions the DrawingView within the ClipView.
  45. DrawingView        - A subclass of View. The view that manages the drawing for a
  46.                     document. Contains the list of graphics.
  47. GraphicImport        - A subclass of Object. Each imported eps and tiff  file is managed
  48.                     through an instance of this object. Uses an NXImage to retain
  49.                     the image of the file offscreen and an NXEPSImageRepSub
  50.                     to swiche DPS contexts when imaging to protect the application's
  51.                     context.
  52. NXEPSImageRepSub - A subclass of NXEPSImageRep. Adds the resource parsing and
  53.                     checking routines, the include file handling and the drawing
  54.                     with rotation.
  55. NXBitmapImageRepSub - A subclass of NXBitmapImageRep. Adds the drawing
  56.                     with rotation.
  57.  
  58. GraphicList        - A subclass of List. Acts like a GraphicEpsf object but just passes
  59.                     each message on to the elements in the list.
  60.  
  61. SaveAsPanel        - A subclass of SavePanel. 
  62. ResourcePanel    - A subclass of Panel that displays the resources specified in the
  63.                     Epsf file but not found in the system.
  64. ImportPanel        - A subclass of OpenPanel. 
  65. ScrollingView        - A subclass of ScrollView.  One method overridden to scroll both the
  66.                     DrawingView and the offscreen buffer of the DrawingView. 
  67. Preferences        - A subclass of Panel. Uses for setting the preferences. 
  68.  
  69. epsfwraps.psw    - Wraps for epsf files.
  70. epsfreader.m        - Routines for parsing Eps files.
  71. epsfwriter.m        - Routines for writing Eps files. 
  72. epsferror.m        - Error codes and messages for parsing errors.
  73.  
  74.  
  75. Topics of interest from ImportAdvanced:
  76.  
  77. Parsing an Eps file (epsfreader)
  78. Resource checking and error flagging (epsfreader, GraphicImport, ResourcePanel)
  79. Imaging an Eps file into an NXImage (GraphicImport)
  80. Dragging out the place for an Eps file (DrawingView, GraphicImport)
  81. Saving As EPS/Illustrator (Document, DrawingView, GraphicImport, NXEPSImageRepSub)
  82.  
  83. Rotating a graphic (DrawingView, GraphicImport, NXEPSImageRepSub,
  84.         NXBitmapImageRepSub rotateprocs)
  85. Multiple graphics (DrawingView, GraphicList)
  86. Returning files to their Original Ratio and Original Size (DrawingView, GraphicImport)
  87. Muliple images per Epsf file (GraphicImport)
  88. Zooming in and out (DocView, DrawingView)
  89. Including a Proc Set (DrawingView)
  90.